]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageList: Recognize URLHighlighter gesture only if clicking on an URL
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 6 Nov 2025 13:37:06 +0000 (14:37 +0100)
committerMarge Bot <marge-bot@gnome.org>
Thu, 6 Nov 2025 14:44:19 +0000 (14:44 +0000)
Otherwise it would still consume the press+release, making the overall
notification unable to handle activation.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8799
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3954>

js/ui/messageList.js

index deed5eb0201de9883733541d1b96f0fdcfe0d0d0..85fc044d343ffc391039e89dee2b287060d126f4 100644 (file)
@@ -56,10 +56,18 @@ class URLHighlighter extends St.Label {
         this.setMarkup(text, allowMarkup);
 
         this._clickGesture = new Clutter.ClickGesture();
-        this._clickGesture.connect('recognize', this._onClick.bind(this));
+        this._clickGesture.connectObject(
+            'recognize', this._onClick.bind(this),
+            'may-recognize', this._checkInUrl.bind(this));
         this.add_action(this._clickGesture);
     }
 
+    _checkInUrl() {
+        const {x, y} = this._clickGesture.get_coords_abs();
+        const urlId = this._findUrlAtPos(x, y);
+        return urlId !== -1;
+    }
+
     _onClick() {
         const {x, y} = this._clickGesture.get_coords_abs();
         const urlId = this._findUrlAtPos(x, y);